<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/react/umd/react.development.js"></script>
    <script src="../node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="../node_modules/babel-standalone/babel.min.js"></script>
</head>

<body>
    <!-- HTML注释 -->
    <div id="root"></div>

    <script type="text/babel">
        const name = "全蛋张"
        const age = 25

        function showObj(obj) {
            return JSON.stringify(obj)
        }

        const myJsx = (
            <div>
                {/* 劳资是JSX注释 劳资的本质是JS注释 所以HTML中不可见 */}
                上面那位爷是JSX注释

                <div>插入一个变量{name}</div>
                <div>插入一个变量{age}</div>
                <div>一年后的年龄{age + 1}</div>
                <div>蛋哥成年了吗?{age > 18 ? "YES" : "NO"}</div>
                <div>插入函数调用：{showObj({ name, age })}</div>
            </div>
        )

        ReactDOM.render(myJsx, document.querySelector("#root"))
    </script>
</body>

</html>